pubset.html<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">
    <link rel="stylesheet" href="/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
</head>
<body>
<div class="layuimini-container" id="app">
    <div class="layuimini-main">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>PC|WAP网页公共设置</legend>
        </fieldset>
        <div lay-filter="form">
            <div class="layui-form-item">
                <label class="layui-form-label">安卓下载地址</label>
                <div class="layui-input-inline">
                    <input type="text"  autocomplete="off" class="layui-input"
                           v-model="downAndriod"
                           style="width:500px;" v-on:blur="setNameVal($event,'downAndriod')"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">IOS下载地址</label>
                <div class="layui-input-inline">
                    <input type="text"  autocomplete="off" class="layui-input"
                           v-model="downIos"
                           style="width:500px;" v-on:blur="setNameVal($event,'downIos')"/>
                </div>
            </div>

        </div>
    </div>
</div>
<style>
    .upload-images .img-box{
        width:100px;height:100px;
    }
    .upload-images .img-box .img{
        width:100px;height:100px;
    }
    .lunbo1-list .item {
        margin-top: 10px;
        border: 1px solid #e0e0e0;
        padding: 20px;
        width: 310px;height: 180px;
        position: relative;
        float: left;
        margin-left: 10px;
        overflow: hidden;
    }
    .lunbo1-list .item img{
        margin-top:10px;
        width: 150px;
        height: 86px;
    }
    .lunbo1-list .item .layui-input{
        margin-top:10px;
    }
    .lunbo1-list .item .icon{
        position: absolute;top:5px;right:5px;
        z-index:1;color:red;font-size:20px;
    }

    .lunbo2-list .item {
        margin-top: 10px;
        border: 1px solid #e0e0e0;
        padding: 20px;
        width: 310px;height: 180px;
        position: relative;
        float: left;
        margin-left: 10px;
        overflow: hidden;
    }
    .lunbo2-list .item img{
        margin-top:10px;
        width: 150px;
        height: 86px;
    }
    .lunbo2-list .item .layui-input{
        margin-top:10px;
    }
    .lunbo2-list .item .icon{
        position: absolute;top:5px;right:5px;
        z-index:1;color:red;font-size:20px;
    }
    .four-btns .item{
        margin-top: 10px;
        border: 1px solid #e0e0e0;
        padding: 20px;
        width: 265px;
        position: relative;
        float: left;
        margin-left: 10px;
        overflow: hidden;
    }
    .four-btns .item .img-box{
        width: 100px;margin-top:10px;
    }
    .four-btns .item .img-box{
        max-width: 100px;min-height: 50px;
    }
    .block-bottom{
        margin-top:10px;
    }
    .block-bottom .item{
        width:410px;height: 270px;
        padding: 20px;
        border: 1px solid #e0e0e0;
        position: relative;
        overflow: hidden;
    }
    .block-bottom .item .image{
        width:33.33%;
    }
    .block-bottom .item .image img{
        max-width: 100%;display: block;margin: 5px 0 0 5px;
    }
    .block-bottom .item .del{
        position: absolute;
        top: 5px;
        right: 5px;
        z-index: 1;
        color: red;
        font-size: 20px;
    }
</style>
<script src="/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/js/common.js?v=5" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['form', 'layedit', 'laydate','jquery','upload'], function () {
        var form = layui.form
            ,$ = layui.jquery
            , layer = layui.layer
            ,upload = layui.upload;

        new Vue({
            el:'#app',
            data:{
                downAndriod:null,
                downIos:null,
            },
            methods:{

                getValByName:function(key){
                    for(var k in this.settings){
                        var row = this.settings[k];
                        if(row.name === key){
                            return row.val
                        }
                    }
                    return null;
                },
                buildFullUrl:function(relativePath){
                    if (!relativePath) return null;
                    return '/' + relativePath;
                },
                setNameVal:function(e,name){
                    var val = e.target.value;
                    settingSetVal(name,val,function(){
                        layer.msg('设置成功',{icon:6,time:500})
                    })
                },
            },
            updated:function(){
                form.render();
            },
            mounted:function(){
                var _this = this;
                $.get('/admin/webManage/settings',{},function(res){
                    var settings = res.data;
                    _this.settings = settings;
                    _this.downAndriod =_this.getValByName('downAndriod');
                    _this.downIos =_this.getValByName('downIos');

                })
            }
        })
    });
</script>
</body>
</html>